<!DOCTYPE html>
<html lang="ch">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //将数组中数字内容求和
        function shuhe(a){
            var he =0;
            for(i=0;i<a.length;i++){
                he+=a[i];
            }
            return he;
        }
        a=[5,4,8,7,6,2,9]
        console.log(shuhe(a))
    </script>
</body>
</html>